import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import AdminLogin from '../views/AdminLogin'
import Home from '../views/Home'
import AddGoods from '../views/goods/AddGoods'
import GoodsList from '../views/goods/GoodsList'
import Start from '../views/goods/Start'
Vue.use(VueRouter)

const routes = [
  {path: '/',redirect:'/login'},
  {path:'/login',component:Login},
  {path:'/adminLogin',component:AdminLogin},
  {path:'/home',component:Home,children:[
      {path: '/addGoods',name: 'addGoods',component: AddGoods},
      {path: '/goodsList',name: 'GoodsList',component: GoodsList},
      {path: '/start',name: 'start',component: Start}
    ]}
]

const router = new VueRouter({
  routes
})

export default router
